A sprite world is a graphics world for a sprite animation. To create a sprite animation in an application, you must first create a sprite world. You do not need to create a sprite world to create a sprite track in a QuickTime movie.
Once you have created a sprite world, you create sprites associated with that sprite world. You can think of a sprite world as a stage on which your sprites perform. When you dispose of a sprite world, its associated sprites are disposed of as well.
For sprites in a sprite world, you modify a sprite's properties by calling the SetSpriteProperty function, passing a constant to indicate which property you want to modify. SetSpriteProperty invalidates the appropriate portions of the sprite world, which are redrawn when SpriteWorldIdle is called.
When you call SetSpriteProperty to modify a property of a sprite, SetSpriteProperty invalidates the appropriate regions of the sprite world. When your application calls SpriteWorldIdle , the sprite world redraws its invalid regions. A sprite's sprite world coordinate system is defined by translating the sprite's display coordinate system by the sprite world's matrix, as shown in Figure 1-1 .
Figure 1 Sprite world coordinate system
For sprites in a sprite world, you control a sprite's image by setting the sprite's kSpritePropertyImageDescription and kSpritePropertyImageDataPtr properties.
| Previous | Chapter Contents | Chapter Top | Next |